//
//  NNEnvSelectViewController.h
//  MockQR
//
//  Created by fangshufeng on 2018/3/5.
//  Copyright © 2018年 fangshufeng. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NNEnvBaseController.h"

@interface NNEnvSelectViewController : NNEnvBaseController

/**
 * 选择环境的回调
 * @[@"STB",@"SIT",@"PRE",@"PROD",@"MOCK"] 返回对应的索引
 */
@property (nonatomic, copy) void (^envSelectAction) (NSInteger index, NSString *proxyUrl);

@property (nonatomic, assign) NSInteger defaultSelectIndex;
@property (nonatomic, copy) NSDictionary *dataDic;


/*
 //使用方法，选择环境后，返回的便是该环境地址
NSDictionary *dataForBeta = @{
                              @"title":@"BETA",
                              @"titleDesc":@"",
                              @"envDesc" : @"为测试环境，进行开发(修改)时，一般新开发（修改）的功能",
                              @"netDesc":@"需连接公司内网",
                              @"ENVList":@[@[@"BETA1",@"http://192.168.111.81:990099"]
                                           ]
                              };

NSDictionary *dataForProd = @{
                              @"title":@"PROD",
                              @"titleDesc":@"",
                              @"envDesc" : @"PROD为正式环境，即线上环境，生产环境。",
                              @"netDesc":@"联网即可",
                              @"ENVList":@[@[@"PROD",@"https://chaojihua.geexwin.com"]]
                              };

NSDictionary *dataForMock = @{
                              @"title":@"MOCK",
                              @"titleDesc":@"STB/dsajdhaks",
                              @"envDesc" : @"MOCK为模拟环境，通过【移动端>模拟接口工具】可以对请求接口进行快捷的修改操作。这样，只要接口定义好，即使后台环境不稳定，也不再影响前端的基本联调测试。",
                              @"netDesc":@"公司内网",
                              @"ENVList":@[@[@"MOCK",@"http://192.168.12.25:7778"]]
                              };

NSDictionary *dict  = @{@"BETA":dataForBeta,
                        @"PROD":dataForProd,
                        @"MOCK":dataForMock
                        };


NNEnvSelectViewController *vc = [[NNEnvSelectViewController alloc] init];
vc.dataDic = dict;
vc.envSelectAction = ^(NSInteger index, NSString *proxyUrl) {
    NSLog(@"==%d===%@",index, proxyUrl);
    if (index <= 1) {
        [AppContext sharedInstance].currentEnvironment = index;
    }
    [AppContext sharedInstance].baseUrltest = proxyUrl;
};

UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:nav animated:YES completion:nil];
*/

@end

